<?php
//引入数据链接文件
require('conn.php');
if(isset($_POST['save'])){
 //  收集 从 insert.html post  提交的数据
    $username = $_POST['username'];
    $email =  $_POST['email'];
    $mobile =  $_POST['mobile'];
}


// //  echo $username.$email.$mobile;

// //把获取的数据插入到数据库
// //构造sql
$sql = "insert into users(name,email,mobile) values('$username','$email','$mobile')";
// $sql = 'insert into users(name,email,mobile) values("'.$username.'","'.$email.'","'.$mobile.'")';
// echo $sql;

if (mysqli_query($link,$sql)) {
    // 执行正确的时候
    //返回首页
   
    header("Location: index.php");
    exit;
} else {
    echo "Error:".mysqli_error($link);
}




?>